package com.viphuli.fragment;

import android.os.Bundle;
import android.view.ViewGroup;
import android.widget.TextView;
import butterknife.Bind;

import com.loopj.android.http.RequestParams;
import com.viphuli.app.R;
import com.viphuli.common.Constants.PayType;
import com.viphuli.http.ApiRequest;

public abstract class PurchaseOrderPayResultFragment extends BaseProgressFragment {

	@Bind(R.id.id_pay_result_item_name)
	protected TextView nameText;

	@Bind(R.id.id_pay_result_item_time)
	protected TextView timeText;

	@Bind(R.id.id_pay_result_item_site)
	protected TextView siteText;

	@Bind(R.id.id_pay_result_item_tel)
	protected TextView telText;

	@Bind(R.id.id_pay_result_item_pay_type)
	protected TextView payTypeText;

	@Bind(R.id.id_pay_result_item_pay_price)
	protected TextView payPriceText;
	
	@Bind(R.id.id_main_content_service_company_order_ticket_title)
	protected TextView ticketTitleText;
	
	@Bind(R.id.id_main_content_service_company_order_ticket)
	protected TextView ticketText;
	
	@Bind(R.id.id_main_content_service_company_order_ticket_layout)
	protected ViewGroup ticketLayout;

	protected String orderId;
	protected int payType;

	@Override
	protected void initParams() {

		Bundle args = getArguments();
		orderId = args.getString("order_id");
		payType = args.getInt("pay_type");

	}

	@Override
	protected void initView() {

		payTypeText.setText(PayType.getType(payType).getName());

		RequestParams params = new RequestParams();
		params.put("order_id", orderId);
		ApiRequest.purchaseOrderPayResult.request(this, params);

	}

	@Override
	protected void initData() {

	}

	public TextView getNameText() {
		return nameText;
	}

	public TextView getTimeText() {
		return timeText;
	}

	public TextView getSiteText() {
		return siteText;
	}

	public TextView getTelText() {
		return telText;
	}

	public TextView getPayTypeText() {
		return payTypeText;
	}

	public TextView getPayPriceText() {
		return payPriceText;
	}

	public String getOrderId() {
		return orderId;
	}

	public TextView getTicketTitleText() {
		return ticketTitleText;
	}

	public void setTicketTitleText(TextView ticketTitleText) {
		this.ticketTitleText = ticketTitleText;
	}

	public TextView getTicketText() {
		return ticketText;
	}

	public void setTicketText(TextView ticketText) {
		this.ticketText = ticketText;
	}

	public ViewGroup getTicketLayout() {
		return ticketLayout;
	}

	public void setTicketLayout(ViewGroup ticketLayout) {
		this.ticketLayout = ticketLayout;
	}
	
}
